<%@ Application Language="C#" %>

<script runat="server">

    int count = 0;
    void Application_Start(object sender, EventArgs e) 
    {
        // Code that runs on application startup
        Application["CountVistor"] = count;

    }
    
    void Application_End(object sender, EventArgs e) 
    {
        //  Code that runs on application shutdown

    }
        
    void Application_Error(object sender, EventArgs e) 
    { 
        // Code that runs when an unhandled error occurs

    }

    void Session_Start(object sender, EventArgs e) 
    {
        // Code that runs when a new session is started
        Session["Order"] = FetCo.Framework.OrderDirection.DESC;
        Session["LanguageSelected"] = 0;
        Session["role"] = int.MinValue;
        Application.Lock();
        // Code that runs when a new session is started
    //    count = (int)Application["CountVistor"];
    //    count = count + 1;
    //    Application["CountVistor"] = count;
    //    Online _dm = OnlineService.GetOnline(1);
    //    _dm.Visits = _dm.Visits + 1;
    //    OnlineService.UpdateOnline(_dm);
       
    }

    void Session_End(object sender, EventArgs e) 
    {

        
        Session["CurrentMenu"] = null;        
        Session["Member"] = null;
        Session["Order"] = null;
        Session["LanguageSelected"] = null;
        Application.Lock();
        count = (int)Application["CountVistor"];
        count = count - 1;
        Application["CountVistor"] = count;
        Application.UnLock();

    }
       
</script>
